/**
 * MyEntity.java
 *
 * $Id$
 *
 */
package swingtest.table.entity;

import java.awt.Color;
import java.util.Date;
import javax.persistence.Entity;
import javax.swing.table.DefaultTableCellRenderer;
import swingtest.table.MyEnumCellRenderer;
import swingtest.table.MyTimeCellRenderer;
import swingtest.table.SwingColumn;

/**
 * 
 * @author Dyego Souza do Carmo
 * @since 
*/
public class MyEntity implements java.io.Serializable {

    private static final long serialVersionUID = 1L;
    @SwingColumn(description="The Id",renderer=DefaultTableCellRenderer.class,colorOfBackgound="")
    private Integer id;
    @SwingColumn(description="Name of People",renderer=DefaultTableCellRenderer.class,colorOfBackgound="")
    private String name;
    @SwingColumn(description="The AGE!",renderer=DefaultTableCellRenderer.class,colorOfBackgound="")
    private int age;
    @SwingColumn(description="Born at",renderer=MyTimeCellRenderer.class,colorOfBackgound="")
    private Date born;
    private EntityType type;
    

    
    /**
     * Construtor padrão
     *
     * @author Dyego Souza do Carmo
     * @version 1.0, 
     */
    public MyEntity(){
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Date getBorn() {
        return born;
    }

    public void setBorn(Date born) {
        this.born = born;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final MyEntity other = (MyEntity) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 41 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    public EntityType getType() {
        return type;
    }

    public void setType(EntityType type) {
        this.type = type;
    }


    
}
